<?php
	include "../head.php";
	
	  // echo "<pre>";
	  // print_r($_SESSION);die;
?>
<head>
    <meta charset="utf-8">
    <title>YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证</title>
	<link rel="stylesheet" type="text/css" href="shoppingcar.css">
</head>
<body>
<center>	
    <div id="header">
        <img src="111.JPG">
    </div>
    <div id="hint">
        <img src="222.JPG">
    </div>
	<br/><br/>
	<h2>
		<a href="cartaction.php?a=clear">清空购物车</a> 
	</h2>
	<hr width="80%"><br/>
		<table width="950px" border="1px">
			<tr>
				<th>ID</th>
				<th>商品名</th>
				<th>商品图片</th>
				<th>单价</th>
				<th>购买数量</th>
				<th>小计</th>
				<th>操作</th>
			</tr>
		<?php
		//var_dump($_SESSION['goods']);die;
		if($_SESSION['goods']){
			foreach($_SESSION['goods'] as $k=>$v){
				echo "<tr>";
				echo "<td>{$v['id']}</td>";
				echo "<td>{$v['goods']}</td>";
				echo "<td><img src='../../../public/uploads/s_{$v['picname']}'></td>";
				echo "<td>{$v['price']}</td>";
				echo "<td><a href='cartaction.php?a=edit&id={$k}&num=-1'><button>&nbsp;-&nbsp;</button></a>  {$v['num']} <a href='cartaction.php?a=edit&id={$k}&num=+1'><button>&nbsp;+&nbsp;</a></button></td>";
				echo "<td>".($v['num']*$v['price'])."</td>";
				echo "<td><a href='cartaction.php?a=del&id={$k}'>删除</a></td>";
				
				echo "</tr>";

			}
		}
		?>
		
		</table>

<!---------------返回与结算--------------------->	
	<div id="kill">
		<div id="return">
			<a href="../list/list.php"><input type="submit" value="继续购物" style="width:75px;height:35px;background:#E6E7E7;color: black"></a>
		</div>
		<div id="clearing">
			<?php if(empty($_SESSION['user']['id'])):?>
			<a href="../denglu/denglu.php"><input type="submit" value="去结算" style="width:75px;height:35px;background:#DE0045;color: white"></a></a>
			<?php else:?>
			<a href="../clearing/clearing.php"><input type="submit" value="去结算" style="width:75px;height:35px;background:#DE0045;color: white"></a></a>
			<?php endif;?>
		</div>
	</div>
<!----------------返回与结算--------------------->	
	<div id="recommed">
		<a href="#"><img src="recommed.JPG"></a>
	</div>
</center>	
	<div id="foot">
		<img src="hkinczio.jpg">
	</div>
</body>
